# -*- coding: utf-8 -*-
# @Time    : 2024/8/29 下午11:42
# @Author  : liujun
# @Email   : 2592730854@qq.com
# @File    : source_modify_page.py
# @Software: PyCharm

from time import sleep
from selenium import  webdriver
from selenium.webdriver.common.by import By
from pages.base_page import BasePage


class  SourceModifyPage(BasePage):
    """编辑线索"""
    url = "/crm/index.php?m=leads&a=edit&id=143"
    phone_locator = (By.ID, "mobile")  # 手机
    source_push_pool_locator = (By.ID, "remove")  # 放入线索池
    save_locator = (By.CSS_SELECTOR, "#form1 > table > tfoot > tr > td > input:nth-child(1)")  # 保存


    def phone(self,phone):
        """输入手机号"""
        self.driver.find_element(*self.phone_locator).clear()
        self.driver.find_element(*self.phone_locator).send_keys(phone)

    def click_save(self):
        """点击保存"""
        self.driver.find_element(*self.save_locator).click()
    def click_source_push_pool(self):
        """点击放入线索池"""
        self.driver.find_element(*self.source_push_pool_locator).click()
    def accept(self):
        self.driver.switch_to.alert.accept()
























